(function(){
	Ext.define('NetShopping.goods.GoodsBaseSelWin',{
		extend:'Ext.window.Window',
		alias:'widget.goodsbaseselwin',
		requires:['NetShopping.goods.GoodsBaseGrid'],
		width:500,
		height:400,
		layout:'fit',
		title:'商品选择',
		items:[
			{
				btConfig:{//默认按钮
					add:false,
					edit:false,
					del:false,
					refresh:false
				},
				xtype:'goodsbasegrid'
			}
		],
		buttons: [
            {
                text: '确定',
                formBind: true, //only enabled once the form is valid
                action:'confirm',
                handler:function(){
                	var grid = this.up('window').down('grid');
                	var records = grid.getSelectionModel().getSelection();
                	if(records.length==1){
                		this.up('window').returnResult(records[0]);
                		this.up('window').close();
                	}else{
                		Ext.Msg.alert('提醒','请选择一条记录!')
                	}
                }
            },
            {
                text: '取消',
                handler: function() {
                    this.up("window").close();
                }
            }
        ],
        returnResult:function(result){
        }
	})
})()